<template>
  <div class="container">
    <div class="header">
      <h1 class="app-title">我的心情DOREMI</h1>
      <p class="slogan">今天你的心情，是Do、是Re、还是Mi？</p>
    </div>
    <div class="header">
      <p class="slogan">让温暖的小鹿，陪伴你走进一段自我探索</p>
    </div>
    <div class="center">
      <img
        class="centerimg"
        src="https://lesson.iapeap.com/DRM/IMG/IMG20251120172802%20%281%29.png"
        alt=""
      />
    </div>
    <div class="center">
      <button class="btn" @click="goToNextPage">自我探索之旅</button>
    </div>
    <!-- 底部导航 -->
    <div class="bottom-nav">
      <div class="nav-item" @click="switchNav('home')">
        <i class="fas fa-home nav-icon"></i>
        <span class="nav-label">首页</span>
      </div>
      <div class="nav-item" @click="switchNav('record')">
        <i class="fas fa-chart-bar nav-icon"></i>
        <span class="nav-label">我的记录</span>
      </div>
      <div class="nav-item" @click="switchNav('resource')">
        <i class="fas fa-calendar-check nav-icon"></i>
        <span class="nav-label">预约咨询</span>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: "CoverPage",
  data() {
    return {
      // 可以添加其他数据属性
    };
  },
  methods: {
    goToNextPage() {
      // 这里可以添加跳转到下一页的逻辑
      this.$router.push("/userHome4");
    },
    switchNav(nav) {
      this.currentNav = nav;
      // 在实际应用中，这里会切换到对应的页面
      if (nav === "home") {
        // 如果已经在首页，不做任何操作
        this.$router.push("/userHome");
      } else if (nav === "record") {
        this.$router.push("/CP/votelogList");
      } else if (nav === "resource") {
        this.$router.push("/appointment/list");
      }
    },
  },
};
</script>

<style scoped>
.container {
  min-height: 100vh;
}

.header {
  text-align: center;
  margin-top: 30px;
  margin-bottom: 40px;
}

.app-title {
  font-size: 32px;
  font-weight: 700;
  color: #5a7c65;
  margin-bottom: 25px;
  letter-spacing: 1px;
}

.slogan {
  font-size: 18px;
  color: #5a7c65;
  font-weight: 400;
  margin-top: 10px;
}
.center {
  display: flex;
  justify-content: center;
}
.center img {
  width: 150px;
}

.pet-selection {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.pet-options {
  display: flex;
  justify-content: space-around;
  margin: 30px 0;
}

.pet-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 15px;
  box-sizing: border-box;
  border-radius: 16px;
  width: 100px;
  cursor: pointer;
  transition: all 0.3s ease;
  background-color: white;
  box-shadow: 0 4px 12px rgba(212, 106, 126, 0.1);
}

.pet-option:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 16px rgba(212, 106, 126, 0.15);
  border: 2px solid #5a7c65;
}

.pet-icon {
  font-size: 40px;
  margin-bottom: 10px;
  color: #5a7c65;
}

.pet-name {
  font-size: 14px;
  font-weight: 500;
  color: #444;
}

.pet-description {
  text-align: center;
  margin: 20px 0 40px;
  color: #5a7c65;
  font-size: 14px;
  line-height: 1.6;
}

.btn {
  background-color: #5a7c65;
  color: white;
  border: none;
  border-radius: 12px;
  padding: 16px 24px;
  box-sizing: border-box;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: center;
  margin-top: 50px;
  box-shadow: 0 4px 8px rgba(248, 182, 193, 0.3);
}

.btn:hover {
  background-color: #5a7c65;
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(248, 182, 193, 0.4);
}

.btn:active {
  transform: translateY(0);
}

/* 响应式调整 */
@media (max-width: 375px) {
  .container {
    padding: 15px;
    box-sizing: border-box;
  }

  .pet-option {
    width: 90px;
    padding: 12px;
    box-sizing: border-box;
  }
}

/* 底部导航 */
.bottom-nav {
  position: absolute;
  width: 100%;
  bottom: 0;
  background-color: white;
  box-sizing: border-box;
  display: flex;
  justify-content: space-around;
  border-top: 1px solid #f0f0f0;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  padding: 8px 16px;
  box-sizing: border-box;
  border-radius: 12px;
  transition: all 0.2s ease;
}

.nav-icon {
  font-size: 20px;
  color: #888;
  margin-bottom: 4px;
}

.nav-item.active .nav-icon {
  color: #8bbd9c;
}

.nav-label {
  font-size: 12px;
  color: #888;
}

.nav-item.active .nav-label {
  color: #8bbd9c;
  font-weight: 500;
}
</style>
